using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using BA.DAL;
using Microsoft.VisualBasic;

namespace BlazeApps.Library.Comments
{
    public class CommentList : Base
    {
        private BA.DAL.DBUtility DAL = new BA.DAL.DBUtility();
        private Procedures Procs = new Procedures();

        public DataSet GetComments(Guid ItemID)
        {
            DAL.CreateDBObjects(ConnectionString, Provider);

            DAL.AddParameter("@ItemID", ItemID);

            return DAL.GetDataSet(Procs.ListCommentsByItemID.ToString().Trim(), System.Data.CommandType.Text, System.Data.ConnectionState.Open);
        }

        public DataSet GetCommentParent(Guid ItemID)
        {
            DAL.CreateDBObjects(ConnectionString, Provider);

            DAL.AddParameter("@ItemID", ItemID);

            return DAL.GetDataSet(Procs.ListCommentParent.ToString().Trim(), System.Data.CommandType.Text, System.Data.ConnectionState.Open);
        }

        public DataSet GetCommentChild(Guid CommentParentID)
        {
            DAL.CreateDBObjects(ConnectionString, Provider);

            DAL.AddParameter("@parentid", CommentParentID);

            return DAL.GetDataSet(Procs.ListCommentChildByParentID.ToString().Trim(), System.Data.CommandType.Text, System.Data.ConnectionState.Open);
        }
    }
}
